UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wHF/UHqlp7HWvNlrIhgoQIMCMRlSE3EppuWiBMq39qU=' 
WHERE 
  key_id = '9776a613750e1505c0fb652f2c9a62af3bcba5f7f73f4d6f7a408150c6b58c07' 
  AND (
    token = 'wHF/UHqlp7HWvNlrIhgoQIMCMRlSE3EppuWiBMq39qU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037