UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zukHHxGAh9U81a9FuP5Nj7Y3e9D+mNZK817rCGLCk5Y='
WHERE
key_id = '47f295ee0c73d1d3b82dc16a734fb7172aa9bc26954975255b63f3135934dc56'
AND (
token = 'zukHHxGAh9U81a9FuP5Nj7Y3e9D+mNZK817rCGLCk5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)