UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YL3QfL5GbUh0J6EQOxkT+VjZUk1xUreIUmtLpXUl8/M='
WHERE
key_id = '12b0510b9f406d9240d7e33b084417a85d4af3cb4a1f578de4806b3735d3cd98'
AND (
token = 'YL3QfL5GbUh0J6EQOxkT+VjZUk1xUreIUmtLpXUl8/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)