UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1CoJMagQgCNO0eUrrV7B7/z7aZOSx/wroUVeadu6YGI=' 
WHERE 
  key_id = 'b9b7440c14b0d2db87ba1666a26a57c168cb85637609a7b6a494673856cf6004' 
  AND (
    token = '1CoJMagQgCNO0eUrrV7B7/z7aZOSx/wroUVeadu6YGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017