UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DgXh8YEzzvHW+WcC1n4q9LPqjRWfwXPsfWrqLiSntmU='
WHERE
key_id = 'dc3f8faea369e7be06e4ebe4bf59679a06b894b7a163bfdc34698306fa52f99c'
AND (
token = 'DgXh8YEzzvHW+WcC1n4q9LPqjRWfwXPsfWrqLiSntmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)