UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PmWhhEzJ62hRNh36sHSDXStLDw2+fBdRZOV10Zwo/14=' 
WHERE 
  key_id = '7d74a17d2de7cb881f01dead64bf4b9fe9162103c38475573a35c9a72f6d0910' 
  AND (
    token = 'PmWhhEzJ62hRNh36sHSDXStLDw2+fBdRZOV10Zwo/14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021