UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nS+L58u2xjQgk0fmmrR/rxrMz8EYnKaz/WDmG78mEIg=' 
WHERE 
  key_id = '34bb642f63b573670e9baf5fb34f46dd2e41ff8ccac9d02589d7b7bf7b3e507c' 
  AND (
    token = 'nS+L58u2xjQgk0fmmrR/rxrMz8EYnKaz/WDmG78mEIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043