UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mK2d3VmSSvduyZy4Do+g3AJsvbafYAGYb1o1ZM9Xxg8=' 
WHERE 
  key_id = '026573fd171b8ecb6783ac15a83f56e610f36a5a0b789e539f048569b73a9fca' 
  AND (
    token = 'mK2d3VmSSvduyZy4Do+g3AJsvbafYAGYb1o1ZM9Xxg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052