UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zvwt0ks009oomli7OwJsRhjzUvWvxD/9wdZLo87tbU8='
WHERE
key_id = '439f8138aa16d7191f31e5393760da082c0598d40e6e4dc1989f1ce53ea9526f'
AND (
token = 'Zvwt0ks009oomli7OwJsRhjzUvWvxD/9wdZLo87tbU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)