UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YqHANRVnIPS4GX3cnshu6y7ejnxYun7DfkSMNjYeXMU='
WHERE
key_id = '93ae591d825f3512857d247ce378eb88126005d385a7cf548440c90557b0d3d9'
AND (
token = 'YqHANRVnIPS4GX3cnshu6y7ejnxYun7DfkSMNjYeXMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)