UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BOvseBquxPxbJyWj2m5k7tSq9e/V+7LeXjpemiD9OyU=' 
WHERE 
  key_id = '72aca6a14850aedd925ddcf6f66f81469b7f5d40abd79f3e76a73400e308b772' 
  AND (
    token = 'BOvseBquxPxbJyWj2m5k7tSq9e/V+7LeXjpemiD9OyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016