UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KuB5nTFBSC2mtVrukmykdYdlr9QaDgGfNdgXyKgK5Xw='
WHERE
key_id = '5075ac5a2c1956befc2ce1862262e60f55c8a8b337f38608fde2e847f00fdac0'
AND (
token = 'KuB5nTFBSC2mtVrukmykdYdlr9QaDgGfNdgXyKgK5Xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)