UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2NmjKKMgxVymG+e3EMVYjTH/Szb+DSCBjGwUVcN0Wg='
WHERE
key_id = '6eb1e9c81baae6e7f31a82f7a4b03301cd86fa0a62386c09a6c27e890fff7e1f'
AND (
token = 'y2NmjKKMgxVymG+e3EMVYjTH/Szb+DSCBjGwUVcN0Wg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)