UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HedmrYx0mIudisd1az1xNjaK8KG4Zra26pKLBysTzKM=' 
WHERE 
  key_id = '379570f11a0758e98c28e094b86556d54956346ca95ac3342d77636d8b683df7' 
  AND (
    token = 'HedmrYx0mIudisd1az1xNjaK8KG4Zra26pKLBysTzKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025