UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SmzCGp9tWEytidOlo/vDQq1WcfTHsGSpMtseFniUXvU=' 
WHERE 
  key_id = 'aecdda244679ab82c8f3101f140794ef791afc36d09e6baae079229357bb3811' 
  AND (
    token = 'SmzCGp9tWEytidOlo/vDQq1WcfTHsGSpMtseFniUXvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030