UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3tYwILAGZkJavpnk5fi2ZfY31WhHAWutAyZM+SpU7/I='
WHERE
key_id = 'b1b24643f821ee9b9edf4890b708ab1964266aa41b60e7002ee35fc9fc3a925c'
AND (
token = '3tYwILAGZkJavpnk5fi2ZfY31WhHAWutAyZM+SpU7/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)