UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'syVasj9zurjyq/gAA8b4XtDJhPyBFqZMz9C75eWgC+4=' 
WHERE 
  key_id = '23408bbca747249a6ad337af774bafb40fa26a09482589635d4e01c724cd76eb' 
  AND (
    token = 'syVasj9zurjyq/gAA8b4XtDJhPyBFqZMz9C75eWgC+4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00097