UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TCY205XeifjqF8kG1Vpve9g74lmpM5JWAOJGFMw4IzI=' 
WHERE 
  key_id = '42cee7f464f56a13e7c952a631591a45ac6f3805112979d44e275163eaf11c34' 
  AND (
    token = 'TCY205XeifjqF8kG1Vpve9g74lmpM5JWAOJGFMw4IzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033