UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D2tincL41qI3VJxpLZjlIOkocbGGlosU/EUQ/Jt0s+0=' 
WHERE 
  key_id = 'e05154d41a793581d716abb7c32d1b9386e0ed0a4551f9a59d49f5de4fcef642' 
  AND (
    token = 'D2tincL41qI3VJxpLZjlIOkocbGGlosU/EUQ/Jt0s+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017