UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cbn9PISKOjFUt6fkeIQQ8CEZLpH8OWgnrf95i/6udVM='
WHERE
key_id = '9388a3e20757f077e29520ced9794546b6ab51b15b0ea76e67b6441e70dac454'
AND (
token = 'Cbn9PISKOjFUt6fkeIQQ8CEZLpH8OWgnrf95i/6udVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)