UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6iSaTrLKb0GpllM3GdNB/gIoY8NUG/U/dCYwq0aXy64=' 
WHERE 
  key_id = '20936f9170b763aea6a8c46eecc19d14cac2ebc412e9d1f7394ea335fd5e5774' 
  AND (
    token = '6iSaTrLKb0GpllM3GdNB/gIoY8NUG/U/dCYwq0aXy64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038