UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxccm9p6SKurQtK46kcuSat421pecVnfz27Ev9FP1io='
WHERE
key_id = '2f1f3b8e7e745536ae811c3d355fb7000865ec83366c25a4eb20af089fc8db26'
AND (
token = 'gxccm9p6SKurQtK46kcuSat421pecVnfz27Ev9FP1io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)