UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kTVF/AOUeoqI00Icyo0TivtCZ/SV4IjGIH1NE3jktTM=' 
WHERE 
  key_id = 'f728054d5417d48eda3f57316530066b505f4b940dabca9e641793b7f2b6865a' 
  AND (
    token = 'kTVF/AOUeoqI00Icyo0TivtCZ/SV4IjGIH1NE3jktTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031