UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JLu/FO6k+jjdIMeBSV/6MAPnMDjDJcjO3UlfuaaJsj0=' 
WHERE 
  key_id = 'e3e3db92e70dd151788174b483123ff97aff539d2955fbb38e3992642523f1b6' 
  AND (
    token = 'JLu/FO6k+jjdIMeBSV/6MAPnMDjDJcjO3UlfuaaJsj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031