UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sG4fp5Txp29JIOqfzPwVS/+0ZRbMTUfWpP95s5NZCgM='
WHERE
key_id = '719b2966247ac347cb4ea367a5e4c6c6d2159526538c2243a3911b444acfd4b0'
AND (
token = 'sG4fp5Txp29JIOqfzPwVS/+0ZRbMTUfWpP95s5NZCgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)