UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qqDigvhfOleF5KGTA7NoNQ/0gt+XezRsABbAMbHLcHw=' 
WHERE 
  key_id = '50c6432a8371124039dfe81dfb0c276c2bf5a2423d29fa8b10762734c6159d5f' 
  AND (
    token = 'qqDigvhfOleF5KGTA7NoNQ/0gt+XezRsABbAMbHLcHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066