UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jKdiUkFbyWE17DrwpLUBB2i3ds0IW13Skmsfpb3LvxI='
WHERE
key_id = '0c041bb71725aba3883e2e12faa807550ee7f1307565049d3b65654e21eb2314'
AND (
token = 'jKdiUkFbyWE17DrwpLUBB2i3ds0IW13Skmsfpb3LvxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)