UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HVZNJ2BjQIuUTNJoUaFThlc08FebIlhQWBOXYAcZwy0=' 
WHERE 
  key_id = '3129bf1a5152db43a6eb98c66c8d9c066aab2d31e2eb55a025348443a429f475' 
  AND (
    token = 'HVZNJ2BjQIuUTNJoUaFThlc08FebIlhQWBOXYAcZwy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055