UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+3Du+OD58WfjJNS71uzpyOhaoYBVnF2jnxUGbRfPHe8='
WHERE
key_id = '04e2fcd642b59996c8b4466a03ace9cbb3d49ebad244870a76f15d059019a61c'
AND (
token = '+3Du+OD58WfjJNS71uzpyOhaoYBVnF2jnxUGbRfPHe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)