UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VlEuompqJiL3orgZxZHP18iZ7+kESJyjW9GB1Z4JcvA='
WHERE
key_id = 'ed18df2a910b0661a3fd44920e48cd4c77adff882279dc9139af8c1d92fb886f'
AND (
token = 'VlEuompqJiL3orgZxZHP18iZ7+kESJyjW9GB1Z4JcvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)