UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SkTCob6pWFyBuGmIzCD1Se5zeCr7AttgUelkgPKZ1w4=' 
WHERE 
  key_id = 'e6aaaf873f83dceff88041a1ec5fff025f00c73a5358ed3be949c4d89ff6497b' 
  AND (
    token = 'SkTCob6pWFyBuGmIzCD1Se5zeCr7AttgUelkgPKZ1w4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019