UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TywVZ++S1VC0s8juqZrD2W49Bk4XcJx0j1LUqeXDYok=' 
WHERE 
  key_id = '737aaada1e1cf0dabf33bd557631ec4b7ab2aaabaf25c024de57d3bc1c569f49' 
  AND (
    token = 'TywVZ++S1VC0s8juqZrD2W49Bk4XcJx0j1LUqeXDYok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018