UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0wx8b9twCFyZeGZrlfXa5YI3JIUI4V0BPOZ2P8lcz9c='
WHERE
key_id = '9054016badbb9d65abc723c03dc8ef29ecebb9bb45f8a00ad66ee0f506c117e5'
AND (
token = '0wx8b9twCFyZeGZrlfXa5YI3JIUI4V0BPOZ2P8lcz9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)