UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1I0d/dgPwARlkBBlbbmrKJuBg3A8jNnwdkAR/iTZZA8='
WHERE
key_id = '4181bc9d52046468949f68175fee6cb2f6c9364a39c9ea04f255aac05862cfee'
AND (
token = '1I0d/dgPwARlkBBlbbmrKJuBg3A8jNnwdkAR/iTZZA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)