UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQBSxotu7YAV1UpWYTzkaE4a6wzhbJsTa+AhkBzT4L0=' 
WHERE 
  key_id = '5fc2bdd2b921b686b8d3371f542623c96fcd7b2bf54d41a70265b260a933eceb' 
  AND (
    token = 'eQBSxotu7YAV1UpWYTzkaE4a6wzhbJsTa+AhkBzT4L0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051