UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jwHudo6tDBvGVDyxUGQDMpqe3AAv8rwENe+XHnKyC3o=' 
WHERE 
  key_id = 'fcdc9a8cafdcd01214ea382c4d8f64dd475e4eda43c33e5ce56ccccb4cbba99f' 
  AND (
    token = 'jwHudo6tDBvGVDyxUGQDMpqe3AAv8rwENe+XHnKyC3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036