UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0clGtJpmNDBFslfNQhem6IjNm7YXAU9AnYZ16DF8cRA=' 
WHERE 
  key_id = '28f39c6cc50979e3950b75f6a97e9596adf95ef6bd858e1ac4b6ea79a9e28daa' 
  AND (
    token = '0clGtJpmNDBFslfNQhem6IjNm7YXAU9AnYZ16DF8cRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025