UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VdMCHX0/jVIdkPVbU92EYdaVT3QoWwLVf1qmsLXeCqo=' 
WHERE 
  key_id = 'e96584b731574e4cd7b8e8cf765745c41814af7e8920e9760b48ba06f1c62e16' 
  AND (
    token = 'VdMCHX0/jVIdkPVbU92EYdaVT3QoWwLVf1qmsLXeCqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039