UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K9+t4KwPJdLwxaE24rTJo9dHB9V/b6AsTK8m+cC48Bs='
WHERE
key_id = '5bc2c1ccd2ac42314c75bcd447cfc054953664f31bb14e53ca308229e63b7722'
AND (
token = 'K9+t4KwPJdLwxaE24rTJo9dHB9V/b6AsTK8m+cC48Bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)