UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ovm1FyplXAhWh8ISCfehsxrEs2cxT0U1wgeV6BFAS7c=' 
WHERE 
  key_id = '2b43e4ceb2934ec61b1b09eec9dd893d2b01f3a7891a7f895f9494382db6e980' 
  AND (
    token = 'Ovm1FyplXAhWh8ISCfehsxrEs2cxT0U1wgeV6BFAS7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039