UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uPlpG6F5cRIHe9CT+yZFZOm2KhHZhWdl/HHX/kpHIvo=' 
WHERE 
  key_id = 'fb8f8d27cd66a23fab0819f3c3578f77b43b38e207db3f184d46888d59419236' 
  AND (
    token = 'uPlpG6F5cRIHe9CT+yZFZOm2KhHZhWdl/HHX/kpHIvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026