UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fYYU1OuBIXDXGslIhI3cWjvHfPM+mMq3GBcug4L0nSM='
WHERE
key_id = '00afee3a04caadf6ab38d06d51d62caaa11f413c03e71895bf115aea1b9444fb'
AND (
token = 'fYYU1OuBIXDXGslIhI3cWjvHfPM+mMq3GBcug4L0nSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)