UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h9hGmM42z4G2Odc0Nr17k5M9yJZQ8PcX1+2RSrHcQyI='
WHERE
key_id = '3b069bdb78735b5b5a3a0de1598999ab814f002522be25a6ac0507cbd21b1f43'
AND (
token = 'h9hGmM42z4G2Odc0Nr17k5M9yJZQ8PcX1+2RSrHcQyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)