UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '468c3pZpblY9GcM9tU0vmlSuA0Cxgf5U4scqfXKEI6A=' 
WHERE 
  key_id = 'ab267b931c1e2821a44b7f7e16c6d971fda3456f0d7ba411cdb8f13e43d32aaf' 
  AND (
    token = '468c3pZpblY9GcM9tU0vmlSuA0Cxgf5U4scqfXKEI6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017