UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SVxoWUoFhcxKFxwFMk2C6t/SOGl3tlUXZGjwSz5wMCg='
WHERE
key_id = 'fb42204d0b62b72fa1edb16182553af00b3e3a5767ecd5834fe14d5fe90c2e3c'
AND (
token = 'SVxoWUoFhcxKFxwFMk2C6t/SOGl3tlUXZGjwSz5wMCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)