UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kq3R/iUemY+4gqgS7MdsX7TMV9M/Q2PJSWNgfJxRbUQ='
WHERE
key_id = '61f22526ef5b93657e02b9ad9f8da9fd8c450050f87b13a2674cb472b2d421da'
AND (
token = 'kq3R/iUemY+4gqgS7MdsX7TMV9M/Q2PJSWNgfJxRbUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)