UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FOmbq7xYzm9rvrphBVfFbdubXUB+Ld9piZ/B1nM4CjE=' 
WHERE 
  key_id = '236ddb40c31c19c550e0d8e5f2812d2e6c5c649985bd5ae012889b8bea4c7490' 
  AND (
    token = 'FOmbq7xYzm9rvrphBVfFbdubXUB+Ld9piZ/B1nM4CjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040