UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZnXB4C/6JCGkVm2KCPrOrIXMuKTqEpmgoD2byJul+M='
WHERE
key_id = 'bff6327e5f604655508f738b3c180a0ded211f3e16e138f7f726156113ce1133'
AND (
token = 'kZnXB4C/6JCGkVm2KCPrOrIXMuKTqEpmgoD2byJul+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)