UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5eqkNoddgOWDbdSxvzvVjKjrNsUygwxS750asfU3Zw='
WHERE
key_id = '9b7c1576698b26bd257e255771e4b40738763ecaebfd958de252820a02d5f2ee'
AND (
token = 'l5eqkNoddgOWDbdSxvzvVjKjrNsUygwxS750asfU3Zw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)