UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lxiEDbS49P6HjPKY74TxwasMNCvv64KCEXKZ/qpJ/W4=' 
WHERE 
  key_id = '75db9d50377f7afea89a474eb4d8679d07c60c700690c1db7379afe58ca4e96c' 
  AND (
    token = 'lxiEDbS49P6HjPKY74TxwasMNCvv64KCEXKZ/qpJ/W4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058