UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Im/16LMWXbDA0XsZtooiKBel5kpYHuezkqHQTcoMMFQ=' 
WHERE 
  key_id = '05deb21cfaf23a47952de69d052ead990abb1c5d01eddb15a35ebdb6f16f740e' 
  AND (
    token = 'Im/16LMWXbDA0XsZtooiKBel5kpYHuezkqHQTcoMMFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061