UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tU29deh85xdNBONv2/KPiU6nxxFEzDM7caQoXdM6nXs=' 
WHERE 
  key_id = '37feccd261d55cf6f942d2edcad8f8f62c67f62da0a1494e5dac9f9c289751fe' 
  AND (
    token = 'tU29deh85xdNBONv2/KPiU6nxxFEzDM7caQoXdM6nXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016