UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JUWXwuVP4uVwdOkFKTL05Hwj8ZrK8cSKsxs+JrBxe+o='
WHERE
key_id = '1ced1b284952f761aaba29d319bdb6e0d118dc80dc054a4c0e7122cc4e8e5048'
AND (
token = 'JUWXwuVP4uVwdOkFKTL05Hwj8ZrK8cSKsxs+JrBxe+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)