UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Cze/CtKaNlLgP7DUgxm4HCQaSKaJzkwoB8ImlbYixo=' 
WHERE 
  key_id = '34d49fad4719fbf85af5b1b7e2e6aa657f351c3c70e37ea608495a93061b70e1' 
  AND (
    token = '6Cze/CtKaNlLgP7DUgxm4HCQaSKaJzkwoB8ImlbYixo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046