UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rTtdqBly0y5mqXsXUvWgdfJAT5kl8mGMZo9NMscKA/Y=' 
WHERE 
  key_id = 'f954c965b81f10bfbde6f0706357c9159dca5b1da63d020c2b0274c28db14d9f' 
  AND (
    token = 'rTtdqBly0y5mqXsXUvWgdfJAT5kl8mGMZo9NMscKA/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031