UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JdLEt1G9EnSrvgBRUVyjLI3BwJxx5Rk4CoFGbkDEls='
WHERE
key_id = 'd8c20a9be77cba9b0464ab86cd3feedf8b2fcc1798c080ced4b8062f49598f54'
AND (
token = '6JdLEt1G9EnSrvgBRUVyjLI3BwJxx5Rk4CoFGbkDEls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)