UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rG/dcXNqPbTu91ebDQTCHm+buWSVi8UiOPCIgjq5vMc=' 
WHERE 
  key_id = '5b662c5d584c433615055946c577a7e1b2e78050c2fae9a8337f4c5604f69a3f' 
  AND (
    token = 'rG/dcXNqPbTu91ebDQTCHm+buWSVi8UiOPCIgjq5vMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033