UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ovMXREvpwJoPn/WHrBHW3mxcVd6XcmGRrcLtLvxJeyA=' 
WHERE 
  key_id = '80d5aeec198693266624f6276ac21411f34251d5c6df622dc597b7aa019d3f15' 
  AND (
    token = 'ovMXREvpwJoPn/WHrBHW3mxcVd6XcmGRrcLtLvxJeyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056