UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yST9Z9gWDF9HhdemkcAHGLBgVxlaKdVT9hDC+KZ1lLA='
WHERE
key_id = '09e193cca5b1fbd35e1aea9f6e1773203021753ba74ffb35f569d4ca63347d92'
AND (
token = 'yST9Z9gWDF9HhdemkcAHGLBgVxlaKdVT9hDC+KZ1lLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)