UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46uIYqjCOwJZcQlW23gi7JlSo/+Jkssxjpge7Zab6a8=' 
WHERE 
  key_id = 'dfad1d4002eae760f5af17f2c924e5fb93b96b40ca083c7cb74cab4701bf5a2a' 
  AND (
    token = '46uIYqjCOwJZcQlW23gi7JlSo/+Jkssxjpge7Zab6a8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042