UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GCBhESWkGRb8peq7ui+AjAibKY1XXC79hwjhkMXlkfE=' 
WHERE 
  key_id = 'e9b9bc3808dff2b9ca2e96b4e8cd0eac20795f02686c7dd65092183490cea3f8' 
  AND (
    token = 'GCBhESWkGRb8peq7ui+AjAibKY1XXC79hwjhkMXlkfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017