UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I/kV8pVaMTVwgcMXYA0crpM3qOhvgxcFVAHOmVuN34U=' 
WHERE 
  key_id = '483e745c55c6da061f6011175530d5d69c7e196f49a0abb9bd9b7eaebd5033b3' 
  AND (
    token = 'I/kV8pVaMTVwgcMXYA0crpM3qOhvgxcFVAHOmVuN34U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025