UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPiBSyxQCmKVAz6z05FYxRb2q58LrlWkbGh58VVl/OE='
WHERE
key_id = '0f8c6bbfc0d7bf7bba18e32fc63432de9235fdec8cd880ee58d68749d89973f9'
AND (
token = 'oPiBSyxQCmKVAz6z05FYxRb2q58LrlWkbGh58VVl/OE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)