UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'trwpAjuJnUt/bmvfZyu4TT025VCv93cBYCzm40gRWMk=' 
WHERE 
  key_id = 'c53c48c99eaef04278990662cfc237080e95a57d11cf8c88f84387fb7ca3dbcb' 
  AND (
    token = 'trwpAjuJnUt/bmvfZyu4TT025VCv93cBYCzm40gRWMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017