UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3SAIywVEf2U+5w/5zposkOYzadgvJ57vIt3/E9/DFAw='
WHERE
key_id = '194232c26bf1dff977f6505486aeb8bd386398e0e8c927c22acd9993d474c426'
AND (
token = '3SAIywVEf2U+5w/5zposkOYzadgvJ57vIt3/E9/DFAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)