UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2uIKcLPhtNPMjgxdgDkYsBrZv2fzYXlqmb1uSWI4RE=' 
WHERE 
  key_id = '1642f4dd6ac1ff9f76ce1baa8bc23cd55bb9f07c03751875d06dc354f7f97abd' 
  AND (
    token = 'e2uIKcLPhtNPMjgxdgDkYsBrZv2fzYXlqmb1uSWI4RE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032