UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9zaDAdu7MIqz6cN1eGckrU4uhXPlWI5CQ+8dFAuM85U=' 
WHERE 
  key_id = '73b7c9eba4a6c45467b0a22a9b79de5ced81d2d378433a0821cb237d0008589d' 
  AND (
    token = '9zaDAdu7MIqz6cN1eGckrU4uhXPlWI5CQ+8dFAuM85U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041